home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
AGSTUT1.ZIP
/
AGSTUT1.PPS
< prev
next >
Wrap
Text File
|
1995-03-04
|
5KB
|
143 lines
;-------------------------------------------------------------PowerPPL v2.1--
; File : LIB1.PPS
; Original by : LONE RUNNER on 03/04/1995 at 16:37:52
; Last update by : LONE RUNNER on 03/04/1995 at 18:07:23
;----------------------------------------------------------------------------
;
;$USEFUNCS
;
;----------------------------------------------------------------------------
Integer v_int1, v_int2, v_int3, v_int4, v_int5, v_int6, v_int7
String v_str1
;----------------------------------------------------------------------------
Declare Procedure PrintFade(String v_arg)
Declare Procedure PrintScramble(String v_arg)
Declare Procedure EffCurseur()
Declare Procedure Synchronize()
;----------------------------------------------------------------------------
Begin
Cls
Print "@X0F"
PrintScramble("This is a string printed with the PrintScramble() Procedure")
PrintLn
PrintFade("This is a string printed with the PrintFade() Procedure")
End
;----------------------------------------------------------------------------
Procedure EffCurseur()
;
; This procedure remove the cursor by changing color to 0, printing a space
; at coordinates (1, 23) and move the cursor back to this position.
;
AnsiPos 1,23
Color 0
Print " "
Backup 1
EndProc
;----------------------------------------------------------------------------
Procedure Synchronize()
;
; This procedure waits for the receiver so the ppe will run exactly at the
; same speed on the remote screen than on the local screen. This is used to
; avoid full modem buffers
;
While (Outbytes() > 0) Do
EndWhile
EndProc
;----------------------------------------------------------------------------
Procedure PrintFade(String v_arg)
;
; This procedure writes a text in color 15 with a fading effect on every
; character
;
For v_int1 = 1 to len(v_arg) ; for each character
If (Mid(v_arg, v_int1, 1) = " ") Then ; if this is a space, no fade
Print "@X0F "
Continue
Endif
Print "@X08" + Mid(v_arg, v_int1, 1) ; print in color 8
v_int2 = getX() ; backup position
v_int3 = getY()
EffCurseur() ; remove cursor
Delay 1 ; wait one tick
AnsiPos v_int2, v_int3 ; restore position
Backup 1 ; move cursor back 1 char
Print "@X07" + Mid(v_arg, v_int1, 1) ; print in color 7
v_int2 = getX()
v_int3 = getY()
EffCurseur()
Delay 1
AnsiPos v_int2, v_int3
Backup 1
Print "@X0F" + Mid(v_arg, v_int1, 1) ; print in color 15
v_int2 = getX()
v_int3 = getY()
EffCurseur()
Delay 1
Synchronize() ; wait for other end
AnsiPos v_int2, v_int3
Next
Endproc
;----------------------------------------------------------------------------
Procedure PrintScramble(String v_arg)
;
; This procedure writes a string with a random scramble effect
;
v_int4 = getx() ; backup position
v_int5 = gety() ;
v_int7 = curcolor() ; backup color
v_int2 = len(v_arg) ; length of string -> v_int2
While (1) Do
v_int1 = random(v_int2-1)+1 ; we randomly generate a number depending on
; v_int2 (witch begins with the string len)
v_int3 = 0
v_int6 = 0
While (1) do ; do until v_int6 is not v_int1 (random number)
inc v_int3
v_str1 = ScrText(v_int4+v_int3-1,v_int5, 1, False)
if (v_str1 = " ") inc v_int6 ; if char pointed is a space, inc v_int6
if (v_int6 = v_int1) Break
Endwhile
AnsiPos v_int4+v_int3-1,v_int5 ; ok so we have now the nth space (n = random)
v_str1 = Mid(v_arg, v_int3, 1)
if (v_str1 != " ") Then ; if the char to print is a space, print
Print v_str1 ; a char 255, if not, print it...
else
Print chr(255)
endif
dec v_int2 ; dec v_int2 so we cannot go over the
if (v_int2 = 0) Break ; amount of spaces available
EffCurseur() ; remove cursor
Delay 1 ; add some delay
Synchronize() ; wait for other end
Color v_int7 ; restore color
Endwhile
; Warning : This procedure NEEDS to find spaces where the string will be
; printed... if not, a endless loop will occur...
; To ensure taht everything is ok, you should add a CLS before or someting
; like :
; Print Space(len(v_arg))
; Backup len(v_arg)
EndProc